package com.fang.consumer.controller;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fang.entity.Dept;
import com.fang.service.IDeptClientService;

@RestController
public class ConsumerDeptController {

	@Autowired
	private IDeptClientService clientService;

	@Resource
	private LoadBalancerClient loadBalancerClient;

	@RequestMapping(value = "/consumer/dept/get")
	public Object getDept(long id) {
		return clientService.get(id);
	}

	@RequestMapping(value = "/consumer/dept/list")
	public Object listDept() {
		return clientService.list();
	}

	@RequestMapping(value = "/consumer/dept/add")
	public Object addDept(Dept dept) {
		return clientService.add(dept);
	}
}
